@extends('master')

@section('content')

      <div class="row-fluid ">
        <div class="span12 box gradient ">
          <div class="title">
          <div class="row-fluid">
          <h3 style="padding-bottom:5px;">
            <div class="tools">
              <a class="btn" href="javascript:history.go(-1)" >
              <i class="fa fa-hand-o-left"></i>返回
              </a>
            </div>
            <i class="fa  fa-barcode"></i> 仓库物品管理

          </h3>
          </div>
          </div><!-- End .title -->
        <div class="content">
          <ul id="tabExample1" class="nav nav-tabs">
            <div class="pull-right span3">
                 <div class="input-append row-fluid">
                  <input type="text" class="span6" id="search-input">
                  <button type="submit" class="btn">搜索</button>
                </div>
            </div>
            <li class="active"><a href="#partner0" data-toggle="tab">产品</a></li>
            <li><a href="#partner1" data-toggle="tab">滤芯</a></li>
            <li><a href="#partner2" data-toggle="tab">配件</a></li>
            <li><a href="#partner3" data-toggle="tab">物料</a></li>
            <li><a href="#partner4" data-toggle="tab">办公资产</a></li>
            <li><a href="#partner5" data-toggle="tab">渠道资产</a></li>
            <li><a href="#partner6" data-toggle="tab">推广资产</a></li>
          </ul>
          <div class="tab-content" id="staff_list">
            <div class="tab-pane fade in active" id="partner0">
            <table id="datatable_in" class="responsive table table-striped table-bordered" style="width:100%;margin-bottom:0">
            <thead>
            <tr>
            	<th width="60">
            		编码
            	</th>
            	<th>
            		名称
            	</th>
            	{{--<th>--}}
            		{{--规格型号--}}
            	{{--</th>--}}
            	<th width="120">
            		单价
            	</th>
            	<th width="120">
            		数量
            	</th>
            	<th width="120">
            		总价(残值)
            	</th>
            	<th width="100">
            		是否残次
            	</th>
            </tr>
            </thead>
            <tbody>
            @foreach($houses as $house)
            <tr>
            	<td>
            		{{ $house->id }}
            	</td>
            	<td>
            		{{ $house->commodity->name }}
            	</td>
            	<td>
            		{{ $house->commodity->price }}
            	</td>
            	<td>
            		{{ $house->count }}
            	</td>
            	<td>
            		{{ $house->count*$house->commodity->price }}
            	</td>
            	<td>
            		@if($house->status == 1)正品@else残次@endif
            	</td>
            	{{--<td>--}}
            		{{--正品--}}
            	{{--</td>--}}
            </tr>
            @endforeach
            </tbody>
            </table>
                <div class="row-fluid control-group">
                 <div class="pull-left span6" action="#">
                    <a class="btn btn-default pull-left mgr5" href="#" role="button">导出excel</a>
                    <!-- 仅限产品的正次品筛选开始 -->
                    <div class="btn-group pull-left" role="group" aria-label="...">
                      <button type="button" class="btn btn-default active">全部</button>
                      <button type="button" class="btn btn-default">正品</button>
                      <button type="button" class="btn btn-default">次品</button>
                    </div>
                    <!-- 仅限产品的正次品筛选结束 -->



                  </div>
                 <div class="span6">
                    <div class="pagination pull-right ">
                      <ul>
                       <li><a href="#">上一页</a></li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">下一页</a></li>
                      </ul>
                    </div>
                  </div>
                </div>
                <br/>
               <!-- End row-fluid -->
            </div>
            <div class="tab-pane fade" id="partner1">
              <div class="empty">
                <p class="oops">OOPS!本类型没有物品</p>
              </div>
            </div>
            <div class="tab-pane fade" id="partner2">
              <div class="empty">
                <p class="oops">OOPS!本类型没有物品</p>
              </div>
            </div>
            <div class="tab-pane fade" id="partner3">
              <div class="empty">
                <p class="oops">OOPS!本类型没有物品</p>
              </div>
            </div>
            <div class="tab-pane fade" id="partner4">
              <div class="empty">
                <p class="oops">OOPS!本类型没有物品</p>
              </div>
            </div>
            <div class="tab-pane fade" id="partner5">
              <div class="empty">
                <p class="oops">OOPS!本类型没有物品</p>
              </div>
            </div>
            <div class="tab-pane fade" id="partner6">
              <div class="empty">
                <p class="oops">OOPS!本类型没有物品</p>
              </div>
            </div>
          </div>
        </div> <!-- End .content -->
        </div>
        <!-- End box -->
      </div>





@stop


@section('script')

<script type='text/javascript'>
    $(window).load(function() {
     $('#loading').fadeOut();
    });
      $(document).ready(function() {
      $('body').css('display', 'none');
      $('body').fadeIn(500);


      $("#logo a, #sidebar_menu a:not(.accordion-toggle), a.ajx").click(function() {
      event.preventDefault();
      newLocation = this.href;
      $('body').fadeOut(500, newpage);
      });
      function newpage() {
      window.location = newLocation;
      }

    });
    </script>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
      var dontSort = [];
                $('#datatable_example thead th').each( function () {
                    if ( $(this).hasClass( 'no_sort' )) {
                        dontSort.push( { "bSortable": false } );
                    } else {
                        dontSort.push( null );
                    }
      } );
      $('#datatable_example').dataTable( {
        "sDom": "<'row table_top_bar'<'row-fluid'>'<'to_hide_phone'>'f'<'>r>t<'row'>",
         "sDom": "<'row table_top_bar'<'row-fluid'<'to_hide_phone' f>>><'row'>",
        "aaSorting": [[ 4, "asc" ]],
        "bPaginate": false,
        "bJQueryUI": false,
        "aoColumns": dontSort
      } );
      $.extend( $.fn.dataTableExt.oStdClasses, {
        "s`": "dataTables_wrapper form-inline"
      } );
    } );
</script>
@stop